package com.bjsxt.mapper;

import com.bjsxt.pojo.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface RoleMapper {

    //查询所有信息
    @Select("select * from t_role")
    List<Role> selectRole();

    //添加角色

    Integer insertRole(Role role);

    //修改角色
    @Update("update t_role set rname=#{rname},rdesc=#{rdesc} where rid=#{rid}")
    Integer updateRole(Role role);

    //删除角色
    @Delete("delete from t_role where rid=#{param1}")
    Integer deleteRole(Integer rid);

    //添加管理员查询
    @Select("SELECT * FROM t_role")
    List<Role> selectRoleName();
}
